//
//  VIewControllerHelper.h
//  unicorn
//
//  Created by weiwang on 13-7-21.
//  Copyright (c) 2013年 weiwang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD.h"

typedef NS_ENUM(NSInteger,VCShowTipType) {
    VCShowTipTypeSuccess,
    VCShowTipTypeError,
    VCShowTipTypeNetError
};

@interface ViewControllerHelper : NSObject<MBProgressHUDDelegate>

@property (nonatomic, weak) UIViewController *ownerViewController;

- (void)backClick:(id)sender;

- (void)setDefaultBackItemWithImage:(UIImage *)image selectedImage:(UIImage *)selectedImage;

- (void)setDefaultBackItemWithImage:(UIImage *)image selectedImage:(UIImage *)selectedImage action:(SEL)action;

//设置navbar左边按钮（图片）
- (void)setLeftItemImage:(UIImage *)image selectedImage:(UIImage *)selectedImage target:(id)target action:(SEL)action;
//设置navbar右边按钮（图片）
- (void)setRightItemImage:(UIImage *)image selectedImage:(UIImage *)selectedImage target:(id)target action:(SEL)action;

- (void)setLeftItemText:(NSString *)text target:(id)target action:(SEL)action;

//设置navbar右边按钮（文字）
- (void)setRightItemText:(NSString *)text target:(id)target action:(SEL)action;

- (UIBarButtonItem *)barWithText:(NSString *)text
                          target:(id)target
                          action:(SEL)action;
- (UIBarButtonItem *)barWithImage:(UIImage *)image
                    selectedImage:(UIImage *)selectedImage
                  backgroundImage:(UIImage *)backgroundImage
          selectedBackgroundImage:(UIImage *)selectedBackgroundImage
                           target:(id)target
                           action:(SEL)action ;

- (void)setNavgationBarImage:(UIImage *)image;
- (void)setNavgationBarHidden:(BOOL)hidden;
- (void)setNavgationBarHidden:(BOOL)hidden animated:(BOOL)animated;

- (void)setTabBarHidden:(BOOL)hidden;

- (void)startAnimating;
- (void)startAnimatingWithText:(NSString *)text;
- (void)stopAnimating;

- (void)showMessageOnlyTip:(NSString*)amsg withTipType:(VCShowTipType)type;

- (void)showWebviewLoading:(UIView *)webview;
- (void)dismissWebviewLoading:(UIView *)webview;

- (void)showAlertWithMessage:(NSString *)msg completion:(dispatch_block_t)completion;
- (void)showAlertWithMessage:(NSString *)msg
                 OtherChoice:(NSString *)otherChoice
                  completion:(dispatch_block_t)completion;
@end
